
						webpage = require("webpage");
page = webpage.create();
page.onResourceRequested = function(request, net) {

  	if (request.url.indexOf('http://tunghoanh.com') === 0){
  	//	net.abort();
  		//console.log(request.url);
	}else{
		//console.log(request.url);
		//console.log(request.url);
	
	}
}

page.settings.loadImages=false;
page.onConsoleMessage = function(msg) {
    console.log(msg);
};

page.onResourceError = function(resourceError) {
    page.reason = resourceError.errorString;
    console.log(page.reason);
    page.reason_url = resourceError.url;
    console.log(page.reason_url);
};

			page.onLoadFinished = function() {
					page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", function() {
							page.evaluate(function() {
										$.ajax({
			    						url : 'http://anime47.com/download/download.php',
			    						type:'POST',
			    						async: false,
			    						cache: false,
			    						data: {
										epid:'105884'
										},
		    						success: function(data){
											
			    							console.log(data);
			    						},
										error: function(jqxhr,textStatus,errorThrown){
				                       	
				                        } //End of log error
		
			    					});// End ajax
			
			    			
		    					}); //End of try evaluation
								phantom.exit();
						}); //end page.include js
			}//End page.onloadfinished

	page.open('http://anime47.com/download/download.php', function(status) {
	if(status === "success") {
		    						//return next(status, url, file);
							
   		//phantom.exit();
    }//Status==successel
	else{
		
	}
});